//
//  ProductTableCell.m
//  quickBatchManager
//
//  Created by 王定波 on 15/10/16.
//  Copyright © 2015年 jack. All rights reserved.
//

#import "ProductTableCell.h"

@implementation ProductTableCell

- (void)awakeFromNib {
    // Initialization code
}




- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        // 初始化时加载collectionCell.xib文件
        NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"ProductTableCell" owner:self options:nil];
        
        // 如果路径不存在，return nil
        if (arrayOfViews.count < 1)
        {
            return nil;
        }
        // 如果xib中view不属于UICollectionViewCell类，return nil
        if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UICollectionViewCell class]])
        {
            return nil;
        }
        // 加载nib
        self = [arrayOfViews objectAtIndex:0];
    }
    return self;
}



-(instancetype)init
{
    self = [super init];
    if (self)
    {
        // 初始化时加载collectionCell.xib文件
        NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"ProductTableCell" owner:self options:nil];
        
        // 如果路径不存在，return nil
        if (arrayOfViews.count < 1)
        {
            return nil;
        }
        // 如果xib中view不属于UICollectionViewCell类，return nil
        if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UICollectionViewCell class]])
        {
            return nil;
        }
        // 加载nib
        self = [arrayOfViews objectAtIndex:0];
        self.contentView.layer.borderWidth = 1;
    }
    return self;
}


-(void) setData:(TableModel*)data
{
    [_productTabView setData:data.tableList];
    _productTabView.productModelLabel.text=[NSString stringWithFormat:@"  %@",data.modelTitle];
    _productTabView.productTotalLabel.text=[NSString stringWithFormat:@"  %@",data.totalTitle];
}


@end
